package com.zttek.photosShareProject.modules.service.share;

import com.baomidou.mybatisplus.plugins.Page;
import com.zttek.photosShareProject.common.json.CommentVO;
import com.zttek.photosShareProject.common.myException.DBException;
import com.zttek.photosShareProject.modules.model.Comment;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Y
 * Date: 2017-08-18
 * Time: 14:48
 */
public interface ICommentService {

    /**
     * 回复
     * @param content *
     * @param shareId *
     * @param userId *
     * @param targetId 所要回复的评论
     * @return *
     */
    Comment newReply(String content, Long[] atIds, Long shareId, Long userId, Long targetId) throws Exception;

    /**
     * 查询评论
     * @param commentId *
     * @return *
     */
    Comment selectComment(Long commentId) throws Exception;

    /**
     * 获取分享第一条评论
     * @param shareId *
     * @return *
     */
    Comment selectFastComment(Long shareId) throws Exception;

    /**
     * 获取分享下的评论
     * @param page *
     * @param shareId *
     * @return *
     */
    Page<Comment> getShareComment(Page<Comment> page, Long shareId) throws Exception;

    void updatePraiseCount(Long commentId, boolean isPlus) throws Exception;

    void praise(Long commentId, Long userId, boolean isPlus) throws Exception;

    List<Long> getUserPraiseList(Long userId) throws Exception;

    /**
     * 删除评论
     * @param id *
     */
    void deleteComment(Long id) throws Exception;

    CommentVO comment2VO(Comment comment, Long userId, boolean withReply) throws Exception;

    List<CommentVO> comment2VO(List<Comment> comments, Long userId, boolean withReply) throws Exception;
}
